import { Space, Table } from 'antd';
import Modal1 from './Modal1/Modal1';
import Modal2 from './Modal2/Modal2';
import Modal3 from './Modal3/Modal3';

const columns = [
    {
        title: '取消原因',
        dataIndex: 'cancelReason',
        key: 'cancelReason'
    },
    {
        // 外键联表查询订单记录表里面的创建时间
        title: '创建时间',
        dataIndex: 'orderTime',
        key: 'orderTime'
    },
    {
        title: '状态',
        dataIndex: 'orderState',
        key: 'orderState'
    },
    {
        width:100,
        title: '操作',
        dataIndex: 'operation',
        key: 'operation',
        render: (text,record) => (
            <Space size="middle">
                <Modal1 name={record}/>
                <Modal2 name={record}/>
                <Modal3/>
            </Space>    
        )
    },
]
const data =[
    {
        key:'1',
        cancelReason:'临时有事，不需要了',
        orderTime:'2018-11-08 19:22:09',
        orderState:'启用'
    },
    {
        key:'2',
        cancelReason:'路上时间太长',
        orderTime:'2018-11-08 19:22:09',
        orderState:'禁用    '
    },
    {
        key:'3',
        cancelReason:'点错了',
        orderTime:'2018-11-08 19:22:09',
        orderState:'启用'
    },
    {
        key:'4',
        cancelReason:'忘记写备注',
        orderTime:'2018-11-08 19:22:09',
        orderState:'启用'
    },
    {
        key:'5',
        cancelReason:'地址/电话填写错误',
        orderTime:'2018-11-08 19:22:09',
        orderState:'启用'
    }
]

function Ordertab() {
    return <div>
        <Table columns={columns} dataSource={data} />
    </div>
}
export default Ordertab;